//package com.plian.system.controller.im;
//
//import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
//import com.baomidou.mybatisplus.core.metadata.IPage;
//import com.plian.Tools.Func;
//import com.plian.Tools.StringPool;
//import com.plian.Tools.base.BaseController;
//import com.plian.Tools.pagedata.PageData;
//import com.plian.system.config.Resubmit;
//import com.plian.system.entity.im.NegativeInvestment;
//import com.plian.system.model.CommonCode;
//import com.plian.system.model.ListResult;
//import com.plian.system.model.R;
//import com.plian.system.mybatis.search.SearchEntity;
//import com.plian.system.mybatis.search.SearchParamEntiy;
//import com.plian.system.mybatis.search.TokenSearch;
//import com.plian.system.mybatis.support.Condition;
//import com.plian.system.mybatis.support.Query;
//import com.plian.system.service.im.NegativeInvestmentService;
//import com.plian.system.vo.im.NegativeInvestmentVO;
//import com.plian.system.wrapper.im.NegativeInvestmentWrapper;
//import io.swagger.annotations.Api;
//import io.swagger.annotations.ApiOperation;
//import lombok.AllArgsConstructor;
//import org.apache.commons.lang3.StringUtils;
//import org.springframework.web.bind.annotation.*;
//import org.springframework.web.multipart.MultipartFile;
//
//import javax.validation.Valid;
//import java.util.List;
//
///**
// * 控制器
// *
// * @since 2023年1月31日15:31:24
// */
//@RestController
//@AllArgsConstructor
//@RequestMapping("api/negativeinvestment")
//@Api(value = "NegativeInvestmentController", tags = "投资负面清单接口")
//public class NegativeInvestmentController extends BaseController {
//
//    private final NegativeInvestmentService negativeInvestmentService;
//
//    private final NegativeInvestmentWrapper negativeInvestmentWrapper;
//
//    @PostMapping("/detail")
//    @ApiOperation(value = "详情", notes = "传入 negativeInvestment")
//    public R<NegativeInvestmentVO> detail(@RequestBody NegativeInvestment negativeInvestment) {
//        return R.data(negativeInvestmentService.getDetailObj(negativeInvestment));
//    }
//
//    @PostMapping("/list")
//    @ApiOperation(value = "分页", notes = "传入query")
//    public ListResult<NegativeInvestmentVO> list(@RequestBody Query query) {
//        List<SearchEntity> entityList = query.getSearch();
//        if (query.getAscs()==null&&query.getDescs()==null){
//            query.setDescs("create_time");
//        }
//        QueryWrapper<NegativeInvestment> queryWrapper = SearchParamEntiy.getQueryWrapper(
//                Condition.getQueryWrapper(new NegativeInvestment()), entityList
//        );
//        TokenSearch<NegativeInvestment> tokenSearch = new TokenSearch<>();
//		tokenSearch.addTokenQuery(queryWrapper, query);
//        IPage<NegativeInvestment> pages = negativeInvestmentService.page(Condition.getPage(query), queryWrapper);
//        List<NegativeInvestmentVO> negativeInvestmentVOS = negativeInvestmentWrapper.entityToVO(pages.getRecords());
//        ListResult<NegativeInvestmentVO> listResult = new ListResult<>(CommonCode.SUCCESS);
//        listResult.setList(negativeInvestmentVOS);
//        listResult.setTotal(Long.valueOf(pages.getTotal()).intValue());
//        return listResult;
//    }
//
//    @PostMapping("/submit")
//    @Resubmit(delaySeconds = 0)
//    @ApiOperation(value = "新增或修改", notes = "传入 negativeInvestmente")
//    public R submit(@Valid @RequestBody NegativeInvestment negativeInvestment) {
//        boolean result = negativeInvestmentService.submit(negativeInvestment);
//
//        return result ? R.data(negativeInvestment) : new R(CommonCode.FAIL);
//    }
//
//    @PostMapping("/remove")
//    @ApiOperation(value = "删除",notes = "传入 ids")
//    public R remove(@RequestBody PageData pd) {
//        List<String> ids = (List<String>)pd.get("ids");
//        return negativeInvestmentService.deleteLogic(Func.toLongList(StringUtils.join(ids, StringPool.COMMA)))
//                ? new R(CommonCode.SUCCESS) : new R(CommonCode.FAIL);
//    }
//
//    @PostMapping(value = "/uploadFile",produces="application/json;charset=UTF-8")
//    @ApiOperation(value = "导入", notes = "传入导入文件")
//    public R uploadFile(@RequestParam("file") MultipartFile multipartFile){
//         negativeInvestmentService.uploadFile(multipartFile);
//         return R.success();
//    }
//}
